import 'package:backend.core/core/domain/entities/api/google_play/api_google_play_purchased_item_acknowledgement_status.dart';
import 'package:backend.core/core/domain/entities/google_play/google_play_purchased_item_acknowledgement_status.dart';

abstract class CreateApiGooglePlayPurchasedItemAcknowledgementStatusFromInternalOne {
  ApiGooglePlayPurchasedItemAcknowledgementStatus call({
    required GooglePlayPurchasedItemAcknowledgementStatus acknowledgementStatus,
  });
}

class CreateApiGooglePlayPurchasedItemAcknowledgementStatusFromInternalOneImpl
    implements CreateApiGooglePlayPurchasedItemAcknowledgementStatusFromInternalOne {
  const CreateApiGooglePlayPurchasedItemAcknowledgementStatusFromInternalOneImpl();

  @override
  ApiGooglePlayPurchasedItemAcknowledgementStatus call({
    required GooglePlayPurchasedItemAcknowledgementStatus acknowledgementStatus,
  }) {
    switch (acknowledgementStatus) {
      case GooglePlayPurchasedItemAcknowledgementStatus.acknowledged:
        return ApiGooglePlayPurchasedItemAcknowledgementStatus.acknowledged;
      case GooglePlayPurchasedItemAcknowledgementStatus.yetToBeAcknowledged:
        return ApiGooglePlayPurchasedItemAcknowledgementStatus.yetToBeAcknowledged;
      case GooglePlayPurchasedItemAcknowledgementStatus.unacknowledgeable:
        return ApiGooglePlayPurchasedItemAcknowledgementStatus.unacknowledgeable;
    }
  }
}
